﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

using Super.Core.DBObjects;
using Super.Core.IDBO;

namespace Super.Core.DBFactory
{
    public class DBFactory
    {
        /// <summary>
        /// 创建数据库信息类接口
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static IDbObject CreateDbObj(string dbTypename)
        {
         

            string path = "Super.Core";
            string typeName = path + ".DBObjects." + dbTypename + ".DbObject";
            object objType = null;
            try
            {
                objType = Assembly.Load(path).CreateInstance(typeName);
              
            }
            catch (System.Exception ex)
            {
                string str = ex.Message;// 记录错误日志
            }
            return (IDbObject)objType;
        }

    }
}
